"""empty message

Revision ID: 6f2988bfc7a5
Revises: fe7ecf952182
Create Date: 2025-08-21 10:24:31.469127

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '6f2988bfc7a5'
down_revision: Union[str, Sequence[str], None] = 'fe7ecf952182'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('schedule_participants', 'confirmed_at')
    op.drop_column('schedule_participants', 'is_required')
    op.drop_column('schedule_participants', 'family_name')
    op.drop_column('schedule_participants', 'notes')
    op.drop_column('schedule_participants', 'has_confirmed')
    op.drop_column('schedule_participants', 'family_id')
    op.add_column('schedules', sa.Column('is_public', sa.Boolean(), nullable=False, comment='是否是家庭日程'))
    op.drop_column('schedules', 'member_id')
    op.drop_column('schedules', 'member_name')
    op.drop_column('schedules', 'location')
    op.drop_column('schedules', 'notes')
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('schedules', sa.Column('notes', sa.TEXT(), nullable=True))
    op.add_column('schedules', sa.Column('location', sa.VARCHAR(length=500), nullable=True))
    op.add_column('schedules', sa.Column('member_name', sa.VARCHAR(length=100), nullable=False))
    op.add_column('schedules', sa.Column('member_id', sa.INTEGER(), nullable=False))
    op.drop_column('schedules', 'is_public')
    op.add_column('schedule_participants', sa.Column('family_id', sa.INTEGER(), nullable=False))
    op.add_column('schedule_participants', sa.Column('has_confirmed', sa.BOOLEAN(), nullable=False))
    op.add_column('schedule_participants', sa.Column('notes', sa.VARCHAR(length=500), nullable=True))
    op.add_column('schedule_participants', sa.Column('family_name', sa.VARCHAR(length=50), nullable=False))
    op.add_column('schedule_participants', sa.Column('is_required', sa.BOOLEAN(), nullable=False))
    op.add_column('schedule_participants', sa.Column('confirmed_at', sa.DATETIME(), nullable=True))
    # ### end Alembic commands ###
